<?
class LogsBO extends BusinessObject{

  /* private function using in constructors */ 
  function setAttributes(){
	$this->fields	= array(
				'id'			=> 'logID',
				'userid'		=> 'logUserID',
				'username'		=>	'logUserName',
        		'date'  => 'logDate',
        		'ip'	=>	'logIP',
        		'text'	=>	'logText'
		);
    BusinessObject::setAttributes();
  }
  /* constructor */
  function LogsBO(){
    /** super(tableName) */
    BusinessObject::BusinessObject("logs");
    $this->setAttributes();
  }
  
  function write($userID,$username,$text)
  {
     $this->userid = $userID; 
     $this->username = $username;
     $this->ip       = $_SERVER["REMOTE_ADDR"];
     $this->date     = date("Y-m-d H:i:s");             
     $this->text     = $text;
     $this->Insert();      
  }  
}
?>